package com.mvp.shq.washer.ui.recharge;

import com.mvp.shq.washer.entity.RechargeBean;
import com.mvp.shq.washer.entity.WxPayBean;
import com.mvp.shq.washer.entity.result.AlipayResult;
import com.mvp.shq.washer.entity.result.BaseResult;
import com.mvp.shq.washer.entity.RechargeMoney;
import com.mvp.shq.washer.entity.RechargeResponse;
import com.mvp.shq.washer.http.Api;
import com.mvp.shq.washer.http.RxSchedulers;

import java.util.List;

import io.reactivex.Observable;

/**
 * Created by Administrator on 2017/8/19.
 */

public class RechargeModel implements RechargeConstract.Model {
    @Override
    public Observable<BaseResult<List<RechargeMoney>>> rechargeMoney() {
        return Api.getInstance().service
                .rechargeMoney()
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<List<RechargeBean>>> getRechargeMoney() {
        return Api.getInstance().service
                .getRechargeMoney()
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<AlipayResult>> recharge(String token, RechargeResponse response) {
        return Api.getInstance().service
                .recharge(token,response)
                .compose(RxSchedulers.io_main());
    }

    @Override
    public Observable<BaseResult<WxPayBean>> wxRecharge(String token, RechargeResponse response) {
        return Api.getInstance().service
                .wxRecharge(token,response)
                .compose(RxSchedulers.io_main());
    }
}
